package cn.smbms.biz.impl;

import java.util.List;

import cn.smbms.dao.IRoleAuthorityDao;
import cn.smbms.bean.model.RoleAuthority;
import cn.smbms.bean.vo.RoleAuthorityVo;
import cn.smbms.biz.IRoleAuthorityBiz;

public class RoleAuthorityBizImpl implements IRoleAuthorityBiz{
	private IRoleAuthorityDao dao;
	public IRoleAuthorityDao getDao() {
		return dao;
	}
	public void setDao(IRoleAuthorityDao dao) {
		this.dao = dao;
	}

	//多条件查询
	@Override
	public List<RoleAuthority> getRoleAuthorityByRoleAuthorityVo(RoleAuthorityVo roleAuthorityVo) {
		return dao.getRoleAuthorityByRoleAuthorityVo(roleAuthorityVo);
	}

	//添加用户
	@Override
	public int add(RoleAuthority roleAuthority) {
		return dao.add(roleAuthority);
	}

	//根据角色权限ID查询用户信息
	@Override
	public RoleAuthority findRoleAuthorityByRoleId(Integer roleAuthorityId) {
		return dao.findRoleAuthorityByRoleId(roleAuthorityId);
	}

	//更新用户信息
	@Override
	public int update(RoleAuthority roleAuthority) {
		return dao.update(roleAuthority);
	}

	//删除用户信息
	@Override
	public int delete(Integer roleAuthorityId) {
		return dao.delete(roleAuthorityId);
	}
	
	//查询用户权限是否重复
	@Override
	public RoleAuthority fetchRoleAuthority(Integer roleId, Integer functionAuthorityId) {
		return dao.fetchRoleAuthority(roleId, functionAuthorityId);
	}
	
	//获取总页数
	@Override
	public RoleAuthorityVo getTotalPages(RoleAuthorityVo roleAuthorityVo) {
		return dao.getTotalPages(roleAuthorityVo);
	}
}
